﻿using Hsp.WebNovels.Common.Constants;
using Hsp.WebNovels.Model.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hsp.WebNovels.Model.Dtos
{
    /// <summary>
    /// 小说数据传输对象
    /// </summary>
    public class NovelDto : Novel
    {
        #region 分页数据属性

        /// <summary>
        /// 记录行号
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int RowNumber { get; set; }

        /// <summary>
        /// 记录总数
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int RecordCount { get; set; }

        #endregion

        /// <summary>
        /// 小说状态：0-连载中；1-已完本；2-已太监；
        /// </summary>
        [DisplayName("小说状态")]
        public string? StatusName
        {
            get
            {
                return Status.HasValue ? EnumsHelper.GetName((EnumStatus)Status) : "";
            }
        }



        /// <summary>
        /// 站点名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? WebName { get; set; }

        /// <summary>
        /// 内容对象名称，如“.yd_text2 p”
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? ContentName { get; set; }

        /// <summary>
        /// 标题内容对象，如“.oneline”
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? HeaderName { get; set; }

        /// <summary>
        /// 下一页地址对象，如“.pereview a:last-child”
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? NextName { get; set; }

        /// <summary>
        /// 下一页按钮包含的名称，如“下一页”
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? NextTitle { get; set; }

        /// <summary>
        /// 当前章节
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? CurrentChapter { get; set; }

        /// <summary>
        /// 下一页地址或起始地址
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? NextUrl { get; set; }

        /// <summary>
        /// 地址是否需要组合？章节地址需要跟小说地址组合
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int UrlCombine { get; set; }

        /// <summary>
        /// 网站地址
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? WebUrl { get; set; }

        /// <summary>
        /// 正文类型：0-文本，1-HTML
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int AnnotationType { get; set; }

        /// <summary>
        /// 换行标识
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? LineSign { get; set; }

        /// <summary>
        /// 正文编码
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string? Encoding { get; set; }
    }
}
